package fun.chutianshu.eescore_full.controller;

import fun.chutianshu.eescore_full.entity.Department;
import fun.chutianshu.eescore_full.service.DepartmentService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 系部表(Department)表控制层
 *
 * @author makejava
 * @since 2021-04-23 16:00:48
 */
@RestController
@RequestMapping("department")
public class DepartmentController {
    /**
     * 服务对象
     */
    @Resource
    private DepartmentService departmentService;

    @GetMapping("queryDeptAndProfessionsByDeptId/{id}")
    public Department queryDeptAndProfessionsByDeptId(@PathVariable(name="id") Integer id){
        return this.departmentService.queryDeptAndProfessionsByDeptId(id);
    }
    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
    @GetMapping("selectOne/{id}")
    public Department selectOne(@PathVariable(name="id") Integer id) {
        return this.departmentService.queryById(id);
    }

}
